#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char *argv[])
{
	if(argc >= 3){
		if(argv[1][1] == 't'){
			int time = 0;
			if(argv[2])
				time = atoi(argv[2]);
			cout<<"The system will sleep after "<<time<<" (s)."<<endl
			<<"Don't kill this window.Waiting..."<<endl;
			_sleep(time*1000);
			cout<<"Sleepping..."<<endl;
			system("rundll32 powrprof.dll,SetSuspendState");
		}else{
			cout<<"Syntax Error"<<endl;
		}
	}else{
		char ch;
		cout<<"Do you want to sleep!?(y/n): ";
		cin>>ch;
		if(ch == 'y')
			system("rundll32 powrprof.dll,SetSuspendState");
	}
	return 0;
}